﻿var onLogin = function () {
    console.log($("#code").val());
    $.ajax({
        url: "onlogin",
        type: "POST",
        dataType: "json",
        data: JSON.stringify({
            code: $("#code").val()
        }),
        contentType: 'application/json; charset=utf-8',
        success: function (data) {
            console.log("成功：" + data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
            console.log("失败：" + textStatus);
            console.log("失败：" + XMLHttpRequest.status + "；" + XMLHttpRequest.statusText);
        },
        beforeSend: function (xhr) {
            /*
            xhr.setRequestHeader("XSRF-TOKEN",
                $('input:hidden[name="__RequestVerificationToken"]').val());
            //*/
        },
        complete: function () {

        }
    });
};